<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>The Keymaster</title>
</head>
<body>
  <script src="https://cdn.bootcss.com/keymaster/1.6.1/keymaster.min.js"></script>
  <h1>
    The Keymaster
  </h1>
  <input type="text" placeholder="a text input">
  <select><option></option><option>select</option></select>
  <textarea placeholder="a textarea"></textarea>
  <ol>
    <li>Press 'c'. Nothing should be logged on console.</li>
    <li>Press 'o' or Enter or Cursor ←. Console should log function call.</li>
    <li>Press 'i'. Switches scope to 'issues'.</li>
    <li>Press 'c'. Console should log function call.</li>
    <li>Press 'o' or Enter or Cursor ←. Console should log function call.</li>
  </ol>
  <p>
    At any time, try pressing ⌘+right, shift+left or ctrl+shift+alt+d.
  </p>
  <p>
    When a input, a select or a textarea element is focused, key inputs should be ignored.
  </p>
  <script>
    key('c', 'issues', function(){
     console.log('c/issues');
    });
    key('command+r, ctrl+r', 'issues', function(){
      console.log('Hijacked Command+R or Ctrl+R, damn!');
      return false;
    });
    key('i', function(){
      key.setScope('issues');
      console.log('Switched to "issues" scope. Command+R or Ctrl+R is now no longer reloading...');
    });
    key('i', function(){
      console.log('(example of multiple assignment)');
    });
    key('o, enter, left', function(){
      console.log('o, enter or left pressed!');
    });
    key('ctrl+c', function(){
      console.log('this is not the command line');
    });
    key('⌘+right,shift+left,ctrl+shift+alt+d', function(event){
      console.log('command+right, or shift+left, or ctrl+shift+alt+d');
      console.log('here is the event: ', event);
      console.log('key.control', key.control);
      console.log('key.ctrl', key.ctrl);
      console.log('key.shift', key.shift);
      console.log('key.alt', key.alt);
      console.log('key["⌘"]', key["⌘"]);
      return false; // prevent default && stop propagation
    });
  </script>
</body></html>